﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using Skyworth.CRM.Common;
using Skyworth.CRM.Service.IBLL;

namespace Skyworth.CRM.Web.Service
{
    /// <summary>
    /// BussinessoppHandler 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class BussinessoppHandler : IHttpHandler
    {
        ICustBussinessoppBLL bssBLL = IocContainer.Instance.Resolve<ICustBussinessoppBLL>();
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string strq = context.Request.QueryString["q"];
            string str = "";
            DataTable table = bssBLL.Query(" and FNumber like '" + strq + "%'");
            foreach (DataRow row in table.Rows)
            {
                str += row["FItemId"] + "|" + row["FNumber"] + "\n";
            }
            context.Response.Write(str);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}